package com.jame.design_mode.singleton;

/**
 * @author : Jame
 * @date : 2021-01-03 17:53
 * 饿汉模式 什么都提前准备好
 **/
public class HungerSingleton {
    //定义一个静态属性,直接创建对象
    private static HungerSingleton hungerSingleton=new HungerSingleton();
    //私有构造
    private HungerSingleton() {
    }
    //公开静态get方法
    public static HungerSingleton getHungerSingleton() {
        return hungerSingleton;
    }
}
